using least square method find the trend values